begin_time=Time.new.to_i
puts begin_time
female_index=4
ages_index=[9,10,11]
panel_file='/home/tzp/linshirenwu/panel/Panel-PanelPool-PC_Region-000000000000000000000008-top100.new_PanelMeta-newchina123.subtractOccupation.newAge_20151030130520'
pf=File.open(panel_file, 'r:UTF-8')
panel_people={}
pf.each do |line|
  lsp=line.to_s.split(',')
  is_female=lsp[female_index] == '1'
  is_age_t=false
  ages_index.each { |aI| is_age_t = true if lsp[aI] == '1' }
  if is_age_t and is_female
    panel_people[lsp[0]]=2
  elsif is_female
    panel_people[lsp[0]]=1
  else
    panel_people[lsp[0]]=0
  end #0表示男1表示女其它2表示女25-39， 1+2是所有女
end
pf.close
puts "panel size : #{panel_people.size}"

log_path='/home/tzp/linshirenwu/10067/10067'
xiangjiao_people=[]
count=[0, 0, 0]
lf=File.open(log_path, 'r:UTF-8')
lf.each do |line|
  l=line.to_s.strip
  if panel_people.has_key? l
    unless xiangjiao_people.find_index l #去重
      xiangjiao_people.push l
      x_flag=panel_people[l]
      count[x_flag] = count[x_flag] + 1 if x_flag
    end
  end
end
lf.close
puts "xiangjiao size : #{xiangjiao_people.size}"
puts count

puts Time.new.to_i - begin_time.to_i